const questionBaseRouter = require('express').Router()
const qbapi = require('../api/questionbase')

questionBaseRouter.use('/echo',(rep,res)=>{
    res.send({
        msg:"/questionbase/  echo"
    });
})

//新建题库
questionBaseRouter.post('/addquestionbase',(req,res)=>{
    qbapi.addquestionbase(req,res);
})

//获取题库列表
questionBaseRouter.get('/questionbaselist',(req,res)=>{
    qbapi.questionbaselist(req,res);
})

//获取我的题库列表
questionBaseRouter.get('/myquestionbaselist',(req,res)=>{
    qbapi.myquestionbaselist(req,res);
})

//修改题库
questionBaseRouter.post('/updataquestionbase',(req,res)=>{
    qbapi.updataquestionbase(req,res);
})

//删除题库
questionBaseRouter.post('/deletequestionbase',(req,res)=>{
    qbapi.deletequestionbase(req,res);
})

//添加题目
questionBaseRouter.post('/addquestion',(req,res)=>{
    qbapi.addquestion(req,res);
})

//获取题库下的题目列表
questionBaseRouter.get('/questionlist',(req,res)=>{
    qbapi.questionlist(req,res);
})

//删除题目
questionBaseRouter.post('/delquestion',(req,res)=>{
    qbapi.delquestion(req,res);
})

module.exports = {
    questionBaseRouter
}